using System;
using System.Collections.Generic;
using System.Linq;
using Voodoo.Tune.Core;

namespace Voodoo.Sauce.Internal.VoodooTune
{
	internal class VoodooTuneAbTestsTracker
	{
		private const string TAG = "VoodooTuneAbTestsTracker";

		private readonly List<string> _abTests;

		private readonly List<string> _cohorts;

		private readonly string _version;

		internal VoodooTuneAbTestsTracker()
		{
			_abTests = VoodooTuneManager.GetAbTestUuidsAsList();
			_cohorts = VoodooTuneManager.GetAbTestCohortUuidsAsList();
			_version = VoodooTuneManager.GetAbTestVersionUuid();
		}

		public void TrackAbTestModifications(Voodoo.Tune.Core.VoodooConfig config)
		{
			TrackAbTestModifications(config.AbTestIdsToList, config.CohortIdsToList, config.VersionNumber);
		}

		private void TrackAbTestModifications(List<string> abTestUuids, List<string> abTestCohortUuids, string abTestVersionUuid)
		{
			if (abTestUuids.SequenceEqual(_abTests) && abTestCohortUuids.SequenceEqual(_cohorts))
			{
				return;
			}
			VoodooLog.LogDebug(Module.VOODOO_TUNE, "VoodooTuneAbTestsTracker", "Tracking A/B Tests modifications");


		}


	}
}
